home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / creat.z / creat
Encoding:
Text File  |  2002-10-03  |  8.6 KB  |  198 lines

  1.  
  2.  
  3.  
  4. ccccrrrreeeeaaaatttt((((2222))))                                                              ccccrrrreeeeaaaatttt((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _cccc_rrrr_eeee_aaaa_tttt - create a new file or rewrite an existing one
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_ssss_tttt_aaaa_tttt_...._hhhh_>>>>
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ffff_cccc_nnnn_tttt_llll_...._hhhh_>>>>
  15.  
  16.      _iiii_nnnn_tttt _cccc_rrrr_eeee_aaaa_tttt_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_p_a_t_h_,,,, _mmmm_oooo_dddd_eeee______tttt _m_o_d_e_))))_;;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      _cccc_rrrr_eeee_aaaa_tttt creates a new ordinary file or prepares to rewrite an existing file
  20.      named by the path name pointed to by _p_a_t_h.
  21.  
  22.      If the file exists, the length is truncated to 0 and the mode and owner
  23.      are unchanged.
  24.  
  25.      If the file does not exist the file's owner ID is set to the effective
  26.      user ID of the process.  The group ID of the file is set to the effective
  27.      group ID of the process or to the group ID of the directory in which the
  28.      file is being created.  This is determined as follows:
  29.           If the underlying filesystem was mounted with the BSD file creation
  30.           semantics flag [see _ffff_ssss_tttt_aaaa_bbbb(4)] or the _SSSS______IIII_SSSS_GGGG_IIII_DDDD bit is set [see
  31.           _cccc_hhhh_mmmm_oooo_dddd(2)] on the parent directory, then the group ID of the new file
  32.           is set to the group ID of the parent directory, otherwise it is set
  33.           to the effective group ID of the calling process.
  34.  
  35.      The mode bits of the file are based on the value of _mmmm_oooo_dddd_eeee, modified as
  36.      follows:
  37.  
  38.           If the group ID of the new file does not match the effective group
  39.           ID or one of the supplementary group IDs, the _SSSS______IIII_SSSS_GGGG_IIII_DDDD bit is
  40.           cleared.
  41.  
  42.           All bits set in the process file mode creation mask are cleared [see
  43.           _uuuu_mmmm_aaaa_ssss_kkkk(2)].
  44.  
  45.           The ``save text image after execution bit'' of the mode is cleared
  46.           [see _cccc_hhhh_mmmm_oooo_dddd(2) for the values of _mmmm_oooo_dddd_eeee]
  47.  
  48.           Upon successful completion, a write-only file descriptor is returned
  49.           and the file is open for writing, even if the mode does not permit
  50.           writing.  The file pointer is set to the beginning of the file.  The
  51.           file descriptor is set to remain open across _eeee_xxxx_eeee_cccc system calls [see
  52.           _ffff_cccc_nnnn_tttt_llll(2)].  A new file may be created with a mode that forbids
  53.           writing.
  54.  
  55.      The call _cccc_rrrr_eeee_aaaa_tttt_((((_p_a_t_h_,,,, _m_o_d_e_)))) is equivalent to:
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                                                         PPPPaaaaggggeeee 1111
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. ccccrrrreeeeaaaatttt((((2222))))                                                              ccccrrrreeeeaaaatttt((((2222))))
  69.  
  70.  
  71.  
  72.          _oooo_pppp_eeee_nnnn_((((_p_a_t_h_,,,, _OOOO______WWWW_RRRR_OOOO_NNNN_LLLL_YYYY _|||| _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT _|||| _OOOO______TTTT_RRRR_UUUU_NNNN_CCCC_,,,, _m_o_d_e_))))
  73.  
  74.      _cccc_rrrr_eeee_aaaa_tttt fails if one or more of the following are true:
  75.  
  76.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS Search permission is denied on a component of the path prefix.
  77.  
  78.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS The file does not exist and write permission on the directory in
  79.             which the file is to be created is denied.
  80.  
  81.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS The file exists and write permission is denied.
  82.  
  83.      _EEEE_AAAA_GGGG_AAAA_IIII_NNNN The file exists, mandatory file/record locking is set, and there
  84.             are outstanding record locks on the file [see _cccc_hhhh_mmmm_oooo_dddd(2)].
  85.  
  86.      _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT _p_a_t_h points outside the allocated address space of the process.
  87.  
  88.      _EEEE_FFFF_BBBB_IIII_GGGG  The file does not exist and the file size limit of the process is
  89.             set to 0 [see _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2)].
  90.  
  91.      _EEEE_IIII_SSSS_DDDD_IIII_RRRR The named file is an existing directory.
  92.  
  93.      _EEEE_IIII_NNNN_TTTT_RRRR  A signal was caught during the _cccc_rrrr_eeee_aaaa_tttt system call.
  94.  
  95.      _EEEE_LLLL_OOOO_OOOO_PPPP  Too many symbolic links were encountered in translating _p_a_t_h.
  96.  
  97.      _EEEE_MMMM_FFFF_IIII_LLLL_EEEE The process has too many open files [see _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2)].
  98.  
  99.      _EEEE_NNNN_AAAA_MMMM_EEEE_TTTT_OOOO_OOOO_LLLL_OOOO_NNNN_GGGG
  100.             The length of the _p_a_t_h argument exceeds {_PPPP_AAAA_TTTT_HHHH______MMMM_AAAA_XXXX}, or the length
  101.             of a _p_a_t_h component exceeds {_NNNN_AAAA_MMMM_EEEE______MMMM_AAAA_XXXX} while ______PPPP_OOOO_SSSS_IIII_XXXX______NNNN_OOOO______TTTT_RRRR_UUUU_NNNN_CCCC is in
  102.             effect.
  103.  
  104.      _EEEE_NNNN_OOOO_TTTT_DDDD_IIII_RRRRA component of the path prefix is not a directory.
  105.  
  106.      _EEEE_NNNN_OOOO_EEEE_NNNN_TTTT A component of the path prefix does not exist.
  107.  
  108.      _EEEE_NNNN_OOOO_EEEE_NNNN_TTTT The path name is null.
  109.  
  110.      _EEEE_RRRR_OOOO_FFFF_SSSS  The named file resides or would reside on a read-only file system.
  111.  
  112.      _EEEE_NNNN_FFFF_IIII_LLLL_EEEE The system file table is full.
  113.  
  114.      _EEEE_NNNN_OOOO_SSSS_PPPP_CCCC The file system is out of inodes.
  115.  
  116.      _EEEE_TTTT_IIII_MMMM_EEEE_DDDD_OOOO_UUUU_TTTT
  117.             The object of the write is located on a remote system which is not
  118.             available [see _iiii_nnnn_tttt_rrrr_oooo(2)].
  119.  
  120. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  121.      _cccc_hhhh_mmmm_oooo_dddd(2), _cccc_llll_oooo_ssss_eeee(2), _dddd_uuuu_pppp(2), _ffff_cccc_nnnn_tttt_llll(2), _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2), _llll_ssss_eeee_eeee_kkkk(2), _oooo_pppp_eeee_nnnn(2),
  122.      _rrrr_eeee_aaaa_dddd(2), _uuuu_mmmm_aaaa_ssss_kkkk(2), _wwww_rrrr_iiii_tttt_eeee(2), _ssss_tttt_aaaa_tttt(5)
  123.  
  124.  
  125.  
  126.  
  127.                                                                         PPPPaaaaggggeeee 2222
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134. ccccrrrreeeeaaaatttt((((2222))))                                                              ccccrrrreeeeaaaatttt((((2222))))
  135.  
  136.  
  137.  
  138. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  139.      Upon successful completion a non-negative integer, namely the lowest
  140.      numbered unused file descriptor, is returned.  Otherwise, a value of -1
  141.      is returned, no files are created or modified, and _eeee_rrrr_rrrr_nnnn_oooo is set to
  142.      indicate the error.
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.                                                                         PPPPaaaaggggeeee 3333
  194.  
  195.  
  196.  
  197.